/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import bean.JcbgBean;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.hl7.fhir.dstu3.model.Encounter;
import org.hl7.fhir.dstu3.model.Patient;
import util.FhirContextContstant;
import util.FormatUtil;
import util.HttpUtil;
import util.MakeTempalteStringUtil;
import util.StringConvertUtil;

/**
 *
 * @author wudihua
 */
public class FhirJcbgGui extends javax.swing.JFrame {

   // private static final Logger LOGGER = LoggerFactory.getLogger(FhirPatientGui.class);
    private static final Logger logger = LogManager.getLogger(FhirJcbgGui.class.getName());
    // public static org.apache.log4j.Logger LOGGER = org.apache.log4j.Logger.getLogger(FhirPatientGui.class);

    
    private JcbgBean jcbgBean;
 
    /**
     * Creates new form FhirPatientGui
     */
    public FhirJcbgGui() {
        logger.info("start FhirPatientGui!!!");
        initComponents();
        
        
    }

    /**
     * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel7 = new javax.swing.JLabel();
        jButton_create = new javax.swing.JButton();
        jButton_update = new javax.swing.JButton();
        jButton_query = new javax.swing.JButton();
        jButton_queryHistory = new javax.swing.JButton();
        jButton_delete = new javax.swing.JButton();
        jLabel_url = new javax.swing.JLabel();
        jTextField_url = new javax.swing.JTextField();
        jScrollPane3 = new javax.swing.JScrollPane();
        jPanel1 = new javax.swing.JPanel();
        jLabel_patientId = new javax.swing.JLabel();
        jLabel_compositionStatus = new javax.swing.JLabel();
        jTextField_id = new javax.swing.JTextField();
        jLabel_compositionTypeAlias = new javax.swing.JLabel();
        jTextField_compositionTypeAlias = new javax.swing.JTextField();
        jLabel_compositionTypeName = new javax.swing.JLabel();
        jTextField_compositionTypeName = new javax.swing.JTextField();
        jLabel_refPatient = new javax.swing.JLabel();
        jTextField_patientId = new javax.swing.JTextField();
        jLabel_refPatientDisplay = new javax.swing.JLabel();
        jTextField_refPatientDisplay = new javax.swing.JTextField();
        jLabel_type = new javax.swing.JLabel();
        jLabel_reportDateTime = new javax.swing.JLabel();
        jTextField_reportDateTime = new javax.swing.JTextField();
        jComboBox_type = new javax.swing.JComboBox<>();
        jLabel_refCompositionAuthor = new javax.swing.JLabel();
        jTextField_refCompositionAuthor = new javax.swing.JTextField();
        jButton_clear = new javax.swing.JButton();
        jLabel_lastUpdated = new javax.swing.JLabel();
        jTextField_lastUpdated = new javax.swing.JTextField();
        jLabel_documentAlias = new javax.swing.JLabel();
        jTextField_documentAlias = new javax.swing.JTextField();
        jLabel_documentAliasName = new javax.swing.JLabel();
        jTextField_documentAliasName = new javax.swing.JTextField();
        jLabel_compositionId = new javax.swing.JLabel();
        jTextField_compositionId = new javax.swing.JTextField();
        jLabel_compositionLastUpdate = new javax.swing.JLabel();
        jTextField_compositionLastUpdate = new javax.swing.JTextField();
        jComboBox_compositionStatus = new javax.swing.JComboBox<>();
        jLabel_refEncounter = new javax.swing.JLabel();
        jTextField_refEncounter = new javax.swing.JTextField();
        jLabel_compositionAuthor = new javax.swing.JLabel();
        jTextField_compositionAuthor = new javax.swing.JTextField();
        jLabel_compositionTitle = new javax.swing.JLabel();
        jTextField_compositionTitle = new javax.swing.JTextField();
        jLabel_compositionLevel = new javax.swing.JLabel();
        jComboBox_compositionLevel = new javax.swing.JComboBox<>();
        jLabel_ = new javax.swing.JLabel();
        jComboBox_patientActive = new javax.swing.JComboBox<>();
        jLabel_patientName = new javax.swing.JLabel();
        jTextField_patientName = new javax.swing.JTextField();
        jLabel_patientPhoneType = new javax.swing.JLabel();
        jComboBox_patientPhoneType = new javax.swing.JComboBox<>();
        jLabel_patientPhoneNumber = new javax.swing.JLabel();
        jTextField_patientPhoneNumber = new javax.swing.JTextField();
        jLabel_patientPhoneUse = new javax.swing.JLabel();
        jComboBox_patientPhoneUse = new javax.swing.JComboBox<>();
        jLabel_patientGender = new javax.swing.JLabel();
        jComboBox_patientGender = new javax.swing.JComboBox<>();
        jLabel_patientBirthdate = new javax.swing.JLabel();
        jTextField_patientBirthdate = new javax.swing.JTextField();
        jLabel_patientAddressType = new javax.swing.JLabel();
        jComboBox_patientAddressType = new javax.swing.JComboBox<>();
        jLabel1 = new javax.swing.JLabel();
        jTextField_patientAddressName = new javax.swing.JTextField();
        jLabel_encounterId = new javax.swing.JLabel();
        jTextField_encounterId = new javax.swing.JTextField();
        jLabel_encounterStatus = new javax.swing.JLabel();
        jComboBox_encounterStatus = new javax.swing.JComboBox<>();
        jLabel_encounterTypeAlias = new javax.swing.JLabel();
        jComboBox_encounterTypeAlias = new javax.swing.JComboBox<>();
        jLabel_encounterTypeName = new javax.swing.JLabel();
        jTextField_encounterTypeName = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jTextField_encounterTypeDetail = new javax.swing.JTextField();
        jLabel_encounterSDateTime = new javax.swing.JLabel();
        jTextField_encounterSDateTime = new javax.swing.JTextField();
        jLabel_encounterEDateTime = new javax.swing.JLabel();
        jTextField_encounterEDateTime = new javax.swing.JTextField();
        jLabel_observationId = new javax.swing.JLabel();
        jTextField_observationId = new javax.swing.JTextField();
        jLabel_observationStatus = new javax.swing.JLabel();
        jComboBox_observationStatus = new javax.swing.JComboBox<>();
        jLabel_observationTypeAlias = new javax.swing.JLabel();
        jComboBox_observationTypeAlias = new javax.swing.JComboBox<>();
        jLabel_observationTypeName = new javax.swing.JLabel();
        jComboBox_observationTypeName = new javax.swing.JComboBox<>();
        jLabel_observationItemAlias = new javax.swing.JLabel();
        jTextField_observationItemAlias = new javax.swing.JTextField();
        jLabel_observationItemName = new javax.swing.JLabel();
        jTextField_observationItemName = new javax.swing.JTextField();
        jLabel_observationDateTime = new javax.swing.JLabel();
        jTextField_observationDateTime = new javax.swing.JTextField();
        jLabel_observationDoctorId = new javax.swing.JLabel();
        jTextField_observationDoctorId = new javax.swing.JTextField();
        jLabel_observationResult = new javax.swing.JLabel();
        jTextField_observationDoctor = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextArea_observationResult = new javax.swing.JTextArea();
        jLabel4 = new javax.swing.JLabel();
        jLabel_observationPositionCode = new javax.swing.JLabel();
        jTextField_observationPositionCode = new javax.swing.JTextField();
        jLabel_observationPosition = new javax.swing.JLabel();
        jTextField_observationPosition = new javax.swing.JTextField();
        jLabel_observationMethodCode = new javax.swing.JLabel();
        jTextField_observationMethodCode = new javax.swing.JTextField();
        jLabel_observationMethod = new javax.swing.JLabel();
        jTextField_observationMethod = new javax.swing.JTextField();
        jLabel_observationEquipment = new javax.swing.JLabel();
        jTextField_observationEquipment = new javax.swing.JTextField();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTextArea_showXml = new javax.swing.JTextArea();
        jComboBox_dataType = new javax.swing.JComboBox<>();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("检查报告");
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jButton_create.setText("创建");
        jButton_create.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_createActionPerformed(evt);
            }
        });

        jButton_update.setText("更新");
        jButton_update.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_updateActionPerformed(evt);
            }
        });

        jButton_query.setText("检索");
        jButton_query.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_queryActionPerformed(evt);
            }
        });

        jButton_queryHistory.setText("获取历史信息");
        jButton_queryHistory.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_queryHistoryActionPerformed(evt);
            }
        });

        jButton_delete.setText("删除");
        jButton_delete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_deleteActionPerformed(evt);
            }
        });

        jLabel_url.setText("服务器URL：");

        jTextField_url.setText("http://192.168.120.70:9093/dj/Bundle");

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jLabel_patientId.setText("资源ID：");

        jLabel_compositionStatus.setText("文档状态：");

        jLabel_compositionTypeAlias.setText("文档编码：");

        jTextField_compositionTypeAlias.setText("28655-1");

        jLabel_compositionTypeName.setText("文档名称：");

        jTextField_compositionTypeName.setText("检查报告");

        jLabel_refPatient.setText("文档关联患者ID：");

        jTextField_patientId.setText("4028f9a76481ee5f016481ef51800000");

        jLabel_refPatientDisplay.setText("文档关联患者显示：");

        jLabel_type.setText("类型：");

        jLabel_reportDateTime.setText("报告日期：");

        jTextField_reportDateTime.setText("2018-05-12 16:30:02");

        jComboBox_type.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "document", "message", "transaction", "transaction-response", "batch", "batch-response", "history", "searchset", "collection" }));

        jLabel_refCompositionAuthor.setText("文档作者ID：");

        jTextField_refCompositionAuthor.setText("example");

        jButton_clear.setText("清空");
        jButton_clear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_clearActionPerformed(evt);
            }
        });

        jLabel_lastUpdated.setText("最后更新日期：");

        jTextField_lastUpdated.setText("2017-05-12 22:12:21");
        jTextField_lastUpdated.setToolTipText("");

        jLabel_documentAlias.setText("文档标识：");

        jTextField_documentAlias.setText("urn:ietf:rfc:3986");

        jLabel_documentAliasName.setText("文档标识名称：");

        jTextField_documentAliasName.setText("urn:uuid:0c3151bd-1cbf-4d64-b04d-cd9187a4c6e0");

        jLabel_compositionId.setText("文档ID：");

        jTextField_compositionId.setText("180f219f-97a8-486d-99d9-ed631fe4fc57");

        jLabel_compositionLastUpdate.setText("文档最近更新时间：");

        jTextField_compositionLastUpdate.setText("2018-05-12 18:12:21");

        jComboBox_compositionStatus.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "final", "preliminary", "amended", "entered-in-error" }));

        jLabel_refEncounter.setText("文档关联就诊ID：");

        jTextField_refEncounter.setText("4028f8c6647cdf9301647ce660d80006");

        jLabel_compositionAuthor.setText("文档作者姓名：");

        jTextField_compositionAuthor.setText("张青山");

        jLabel_compositionTitle.setText("文档标题：");

        jTextField_compositionTitle.setText("检查报告");

        jLabel_compositionLevel.setText("文档密级：");

        jComboBox_compositionLevel.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "N", "U", "L", "M", "R", "V", " " }));

        jLabel_.setText("患者是否使用：");

        jComboBox_patientActive.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "true", "false" }));

        jLabel_patientName.setText("患者姓名：");

        jLabel_patientPhoneType.setText("患者联系类型：");

        jComboBox_patientPhoneType.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "phone", "fax", "email", "pager", "url", "sms", "other" }));
        jComboBox_patientPhoneType.setAutoscrolls(true);

        jLabel_patientPhoneNumber.setText("患者联系方式：");

        jLabel_patientPhoneUse.setText("使用范围：");

        jComboBox_patientPhoneUse.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "mobile", "home", "work", "temp", "old" }));

        jLabel_patientGender.setText("性别：");

        jComboBox_patientGender.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "男", "女", "其他", "未知" }));

        jLabel_patientBirthdate.setText("出生日期:");

        jLabel_patientAddressType.setText("地址使用范围：");

        jComboBox_patientAddressType.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "home", "work", "temp", "old" }));

        jLabel1.setText("地址：");

        jLabel_encounterId.setText("就诊标识：");

        jTextField_encounterId.setText("111");

        jLabel_encounterStatus.setText("就诊状态：");

        jComboBox_encounterStatus.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "finished", "planned", "arrived", "triaged", "in-progress", "onleave", "cancelled", "enter-in-error", "unknown" }));

        jLabel_encounterTypeAlias.setText("就诊类型编码:");

        jComboBox_encounterTypeAlias.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "IMP", "AMB", "EMER", "FLD", "HH", "ACUTE", "NONAC", "PRENC", "SS", "VR" }));

        jLabel_encounterTypeName.setText("就诊类型:");

        jLabel2.setText("科室：");

        jTextField_encounterTypeDetail.setText("心外科");

        jLabel_encounterSDateTime.setText("开始时间：");

        jLabel_encounterEDateTime.setText("结束时间：");

        jLabel_observationId.setText("检查结果ID：");

        jTextField_observationId.setText("ecg");

        jLabel_observationStatus.setText("检查状态：");

        jComboBox_observationStatus.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "registered", "preliminary", "final", "amended", "corrected", "cancelled", "entered-in-error", "unknown" }));

        jLabel_observationTypeAlias.setText("检查类型编码：");

        jComboBox_observationTypeAlias.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "social-history", "vital-signs", "imaging", "laboratory", "procedure", "survey", "exam", "therapy" }));

        jLabel_observationTypeName.setText("检查类型显示：");

        jComboBox_observationTypeName.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Social History", "Vital Signs", "Imaging", "Laboratory", "Procedure", "Survey", "Exam", "Therapy" }));

        jLabel_observationItemAlias.setText("检查项目编码：");

        jTextField_observationItemAlias.setText("80859-2");

        jLabel_observationItemName.setText("检查项目显示：");

        jTextField_observationItemName.setText("心脏彩色多普勒超声");

        jLabel_observationDateTime.setText("检查时间：");

        jTextField_observationDateTime.setText("2018-05-13 09:30:35");

        jLabel_observationDoctorId.setText("检查医生ID：");

        jTextField_observationDoctorId.setText("f005");

        jLabel_observationResult.setText("检查医生姓名：");

        jTextField_observationDoctor.setText("张青山");

        jTextArea_observationResult.setColumns(20);
        jTextArea_observationResult.setRows(5);
        jTextArea_observationResult.setText("M 型/二维测量和计算              主肺动脉内径: 2.1 厘米    室间隔舒张末期 厚度: 0.85 厘米    射血分数(Teich): 66.3%            多普勒测试和计算              主动脉瓣上最大流速: 141.5 厘米/秒    二 尖瓣 E 峰速度: 82.8 厘米/秒            大血管 主动脉根部内径正常。肺动脉主干内径 正常。            心房 左房扩大。右房内径正常。");
        jScrollPane1.setViewportView(jTextArea_observationResult);

        jLabel4.setText("检查结果：");

        jLabel_observationPositionCode.setText("检查部位编码：");

        jTextField_observationPositionCode.setText("71341001:272741003=2643008");

        jLabel_observationPosition.setText("检查部位：");

        jTextField_observationPosition.setText("心脏");

        jLabel_observationMethodCode.setText("检查方法编码：");

        jTextField_observationMethodCode.setText("71341001:272741003=2643008");

        jLabel_observationMethod.setText("检查方法：");

        jTextField_observationMethod.setText("正位");

        jLabel_observationEquipment.setText("检查设备：");

        jTextField_observationEquipment.setText("彩色多普勒超声");
        jTextField_observationEquipment.setToolTipText("");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGap(88, 88, 88)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jComboBox_encounterTypeAlias, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel_encounterTypeName)
                                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jTextField_encounterSDateTime)
                                .addGap(309, 309, 309))))
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel_patientBirthdate)
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel_encounterTypeAlias)
                                        .addComponent(jLabel2))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jTextField_encounterTypeDetail, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGap(296, 296, 296))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jTextField_encounterTypeName, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel1)
                                .addGap(54, 54, 54)
                                .addComponent(jTextField_patientAddressName, javax.swing.GroupLayout.PREFERRED_SIZE, 417, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel_observationPositionCode)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jTextField_observationPositionCode))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel_observationMethodCode)
                                    .addComponent(jLabel_observationEquipment))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jTextField_observationMethodCode)
                                    .addComponent(jTextField_observationEquipment))))
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jLabel_observationPosition)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextField_observationPosition, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jLabel_observationMethod)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextField_observationMethod))))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jButton_clear)
                                .addGap(41, 41, 41))))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel_refCompositionAuthor)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addComponent(jLabel_compositionTitle)
                                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addGroup(jPanel1Layout.createSequentialGroup()
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addComponent(jTextField_refCompositionAuthor, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                                    .addGap(10, 10, 10)
                                                    .addComponent(jTextField_compositionTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jLabel_compositionAuthor)
                                                .addComponent(jLabel_compositionLevel))))
                                    .addGap(34, 34, 34)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jComboBox_compositionLevel, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jTextField_compositionAuthor)))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addComponent(jLabel_refEncounter)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jTextField_refEncounter, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel_reportDateTime)
                                    .addGap(58, 58, 58)
                                    .addComponent(jTextField_reportDateTime, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 519, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel_lastUpdated)
                                        .addComponent(jLabel_patientId))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addComponent(jTextField_lastUpdated, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel_documentAlias))
                                        .addComponent(jTextField_id)))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel_patientPhoneUse)
                                        .addComponent(jLabel_encounterId))
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addGap(27, 27, 27)
                                            .addComponent(jComboBox_patientPhoneUse, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel_patientGender))
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addGap(27, 27, 27)
                                            .addComponent(jTextField_patientBirthdate, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel_patientAddressType))
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addGap(30, 30, 30)
                                            .addComponent(jTextField_encounterId, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel_encounterStatus)))
                                    .addGap(46, 46, 46)
                                    .addComponent(jComboBox_encounterStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                            .addComponent(jLabel_observationTypeAlias)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jComboBox_observationTypeAlias, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jLabel_observationItemAlias)
                                                .addComponent(jLabel_observationDateTime)
                                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addComponent(jLabel_observationDoctorId)
                                                    .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING)))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jTextField_observationDoctorId)
                                                .addComponent(jTextField_observationItemAlias)
                                                .addComponent(jTextField_observationDateTime))))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                                .addComponent(jLabel_observationResult)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jTextField_observationDoctor, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addComponent(jLabel_observationItemName)
                                                .addGap(181, 181, 181)))
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jTextField_observationItemName, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                                .addComponent(jLabel_observationTypeName)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jComboBox_observationStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jComboBox_observationTypeName, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jTextField_encounterEDateTime, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE))))))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addComponent(jLabel_)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jComboBox_patientActive, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel_patientName))
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addComponent(jLabel_patientPhoneType)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jComboBox_patientPhoneType, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel_patientPhoneNumber)))
                                    .addGap(32, 32, 32)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jComboBox_patientAddressType, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                            .addComponent(jTextField_patientPhoneNumber, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 184, Short.MAX_VALUE)
                                            .addComponent(jComboBox_patientGender, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jTextField_patientName, javax.swing.GroupLayout.Alignment.LEADING))))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addComponent(jLabel_observationId)
                                            .addGap(18, 18, 18)
                                            .addComponent(jTextField_observationId, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addComponent(jLabel_encounterSDateTime))
                                    .addGap(32, 32, 32)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel_encounterEDateTime)
                                        .addComponent(jLabel_observationStatus)))
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                    .addComponent(jLabel_refPatient)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jTextField_patientId, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel_refPatientDisplay)
                                    .addGap(10, 10, 10)
                                    .addComponent(jTextField_refPatientDisplay))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel_compositionTypeAlias)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addComponent(jTextField_compositionTypeAlias, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jLabel_compositionTypeName))
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jLabel_type)
                                                    .addComponent(jLabel_compositionId)
                                                    .addComponent(jLabel_compositionLastUpdate))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jTextField_compositionLastUpdate, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jLabel_compositionStatus))))
                                    .addGap(24, 24, 24)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jComboBox_compositionStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jTextField_compositionTypeName, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jTextField_documentAlias, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                        .addComponent(jLabel_documentAliasName)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(jComboBox_type, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jTextField_compositionId)
                                            .addComponent(jTextField_documentAliasName, javax.swing.GroupLayout.DEFAULT_SIZE, 431, Short.MAX_VALUE))))))
                        .addContainerGap(23, Short.MAX_VALUE))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_patientId)
                    .addComponent(jTextField_id, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_lastUpdated)
                    .addComponent(jTextField_lastUpdated, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_documentAlias)
                    .addComponent(jTextField_documentAlias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(11, 11, 11)
                        .addComponent(jLabel_documentAliasName))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField_documentAliasName, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_type)
                    .addComponent(jComboBox_type, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_compositionId)
                    .addComponent(jTextField_compositionId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_compositionLastUpdate)
                    .addComponent(jTextField_compositionLastUpdate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_compositionStatus)
                    .addComponent(jComboBox_compositionStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_compositionTypeAlias)
                    .addComponent(jTextField_compositionTypeAlias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_compositionTypeName)
                    .addComponent(jTextField_compositionTypeName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_refPatient)
                    .addComponent(jTextField_patientId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_refPatientDisplay)
                    .addComponent(jTextField_refPatientDisplay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_refEncounter)
                    .addComponent(jTextField_refEncounter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_reportDateTime)
                    .addComponent(jTextField_reportDateTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_refCompositionAuthor)
                    .addComponent(jTextField_refCompositionAuthor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_compositionAuthor, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField_compositionAuthor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_compositionTitle)
                    .addComponent(jTextField_compositionTitle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_compositionLevel)
                    .addComponent(jComboBox_compositionLevel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_)
                    .addComponent(jComboBox_patientActive, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_patientName)
                    .addComponent(jTextField_patientName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_patientPhoneType)
                    .addComponent(jComboBox_patientPhoneType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_patientPhoneNumber)
                    .addComponent(jTextField_patientPhoneNumber, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_patientPhoneUse)
                    .addComponent(jComboBox_patientPhoneUse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_patientGender)
                    .addComponent(jComboBox_patientGender, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_patientBirthdate)
                    .addComponent(jTextField_patientBirthdate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_patientAddressType)
                    .addComponent(jComboBox_patientAddressType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jTextField_patientAddressName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_encounterId)
                    .addComponent(jTextField_encounterId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_encounterStatus)
                    .addComponent(jComboBox_encounterStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_encounterTypeAlias)
                    .addComponent(jComboBox_encounterTypeAlias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_encounterTypeName)
                    .addComponent(jTextField_encounterTypeName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jTextField_encounterTypeDetail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_encounterSDateTime)
                    .addComponent(jTextField_encounterSDateTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_encounterEDateTime)
                    .addComponent(jTextField_encounterEDateTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_observationId)
                    .addComponent(jTextField_observationId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_observationStatus)
                    .addComponent(jComboBox_observationStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_observationTypeAlias)
                    .addComponent(jComboBox_observationTypeAlias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_observationTypeName)
                    .addComponent(jComboBox_observationTypeName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_observationItemAlias)
                    .addComponent(jTextField_observationItemAlias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_observationItemName, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTextField_observationItemName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_observationDateTime)
                    .addComponent(jTextField_observationDateTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_observationDoctorId)
                    .addComponent(jTextField_observationDoctorId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel_observationResult)
                    .addComponent(jTextField_observationDoctor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel4)
                .addGap(2, 2, 2)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel_observationPositionCode)
                            .addComponent(jTextField_observationPositionCode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel_observationPosition)
                            .addComponent(jTextField_observationPosition, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel_observationMethodCode)
                            .addComponent(jTextField_observationMethodCode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel_observationMethod)
                            .addComponent(jTextField_observationMethod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel_observationEquipment)
                            .addComponent(jTextField_observationEquipment, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(29, 29, 29))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(jButton_clear)
                        .addContainerGap())))
        );

        jScrollPane3.setViewportView(jPanel1);

        jTextArea_showXml.setColumns(20);
        jTextArea_showXml.setRows(5);
        jScrollPane4.setViewportView(jTextArea_showXml);

        jComboBox_dataType.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "xml", "json" }));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 575, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 418, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(61, 61, 61)
                                .addComponent(jLabel7))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jButton_create)
                                .addGap(18, 18, 18)
                                .addComponent(jButton_query)
                                .addGap(18, 18, 18)
                                .addComponent(jButton_update)
                                .addGap(18, 18, 18)
                                .addComponent(jButton_queryHistory)
                                .addGap(18, 18, 18)
                                .addComponent(jButton_delete)))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel_url)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTextField_url, javax.swing.GroupLayout.PREFERRED_SIZE, 609, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jComboBox_dataType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton_create)
                    .addComponent(jButton_query)
                    .addComponent(jButton_queryHistory)
                    .addComponent(jButton_delete)
                    .addComponent(jButton_update))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel_url)
                        .addComponent(jTextField_url, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jComboBox_dataType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jScrollPane4)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 890, Short.MAX_VALUE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton_createActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_createActionPerformed
        //关联患者和就诊
        JcbgBean jcbgBean = relatePatientAndEncounterBean(evt);
        
        String url = this.jTextField_url.getText();
        String bundleString = "";
        String result = "";
        //获取发送数据的类型 xml/json
        String datatType = this.jComboBox_dataType.getSelectedItem().toString();
        
        if ("xml".equals(datatType)) {
            bundleString = MakeTempalteStringUtil.makeJcbgString(jcbgBean, "/template/jcbgTemplate.xml");
            bundleString = FormatUtil.formatXml(bundleString);
            logger.info("创建 bundle xml: {}",  bundleString);
            result = HttpUtil.sendPost(url, bundleString, HttpUtil.ContentType_xml);
            result = FormatUtil.formatXml(result);
        } else if ("json".equals(datatType)){
            bundleString = MakeTempalteStringUtil.makeJcbgString(jcbgBean, "/template/json/jcbgTemplate.json");
            logger.info("创建 bundle json: {}", bundleString);
            result = HttpUtil.sendPost(url, bundleString, HttpUtil.ContentType_json);
            result = FormatUtil.formatJson(result);
        }
        
//        String bundleXml = MakeXmlUtil.makeJcbgXml(jcbgBean);
//        bundleXml = FormatXmlUtil.formatXml(bundleXml);
//        logger.info("创建 bundleXml: " + bundleXml);
//        
//        String url = this.jTextField_url.getText();
//        String result = HttpUtil.sendPost(url, bundleXml);
        //logger.info("{} result:{}",url,result);

        this.jTextArea_showXml.setText(result);
        logger.info("创建成功");
        // 创建:
    }//GEN-LAST:event_jButton_createActionPerformed
    //关联患者和就诊
    private JcbgBean relatePatientAndEncounterBean(java.awt.event.ActionEvent evt) {
        String url = this.jTextField_url.getText();
        //获取发送数据的类型 xml/json
        String datatType = this.jComboBox_dataType.getSelectedItem().toString();
        jcbgBean = new JcbgBean();
        
        //首先查询关联的id是否存在
        //关联患者 id
        String patientId = this.jTextField_patientId.getText();
        jcbgBean.setPatientId(patientId);
        //关联就诊 id
        String encounterId = this.jTextField_refEncounter.getText();
        jcbgBean.setRefEcounter(encounterId);
        
        String baseUrl = url.substring(0, url.indexOf("Bundle"));
        String queryPatientUrl = baseUrl + "/Patient/" + patientId;
        String queryEncounterUrl = baseUrl + "/Encounter/" + encounterId;
        String queryPatientResult = null;
        String queryEncounterResult = null;
        
        if ("xml".equals(datatType)) {
            queryPatientResult = HttpUtil.sendGet(queryPatientUrl,HttpUtil.ContentType_xml);
            queryEncounterResult = HttpUtil.sendGet(queryEncounterUrl,HttpUtil.ContentType_xml);
            if (queryPatientResult.contains("OperationOutcome")||queryPatientResult.length()<100) { //没对应患者id 报错
                this.jTextArea_showXml.setText(queryPatientResult);
                //结束
            }else if (queryEncounterResult.contains("OperationOutcome")||queryEncounterResult.length()<100) {//没对应就诊id 报错
                this.jTextArea_showXml.setText(queryEncounterResult);
                //结束
            }else{  
                //患者
                Patient patient = FhirContextContstant.getXMLParse().parseResource(Patient.class, queryPatientResult);
                String patientName = patient.getNameFirstRep().getText();
                jcbgBean.setRefPatientDisplay(patientName); 
                jcbgBean.setPatientActive("true");
                jcbgBean.setPatientNameAll(patientName);
                jcbgBean.setPatientFamilyName(patientName.substring(0,1));
                jcbgBean.setPatientGivenName(patientName.substring(1,patientName.length()));

                jcbgBean.setPatientPhoneType(patient.getTelecomFirstRep().getSystem().toCode());
                jcbgBean.setPatientPhoneNumber(patient.getTelecomFirstRep().getValue());
                jcbgBean.setPatientPhoneUse(patient.getTelecomFirstRep().getUse().toCode());

                jcbgBean.setPatientGender(patient.getGender().toCode());
                
                jcbgBean.setPatientBirthdate(new SimpleDateFormat("yyyy-MM-dd").format(patient.getBirthDate()));

                jcbgBean.setPatientAddressType(patient.getAddressFirstRep().getUse().toCode());    
                jcbgBean.setPatientAddressName(patient.getAddressFirstRep().getText());
                
                //就诊
                Encounter encounter =  FhirContextContstant.getXMLParse().parseResource(Encounter.class, queryEncounterResult);
                
                //jcbgBean.setEncounterId(encounter.getIdentifierFirstRep().getValue());
                 jcbgBean.setEncounterId(this.jTextField_encounterId.getText());
                jcbgBean.setEncounterStatus(encounter.getStatus().toCode());
                jcbgBean.setEncounterTypeAlias(encounter.getClass_().getCode());
                jcbgBean.setEncounterTypeName(encounter.getClass_().getDisplay());
                //jcbgBean.setEncounterTypeDetail(encounter.getTypeFirstRep().getText());
                jcbgBean.setEncounterTypeDetail(this.jTextField_encounterTypeDetail.getText());

                jcbgBean.setEncounterSDateTime(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(encounter.getPeriod().getStart()));
                jcbgBean.setEncounterEDateTime(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(encounter.getPeriod().getEnd()));
                
                //执行创建
                return setJcbg(evt, jcbgBean);
            }
        }else if ("json".equals(datatType)){
            queryPatientResult = HttpUtil.sendGet(queryPatientUrl,HttpUtil.ContentType_json);
            queryEncounterResult = HttpUtil.sendGet(queryEncounterUrl,HttpUtil.ContentType_json);
            if (queryPatientResult.contains("OperationOutcome")||queryPatientResult.length()<100) {//没对应患者id 报错
                this.jTextArea_showXml.setText(queryPatientResult);
                //结束
            }else if (queryEncounterResult.contains("OperationOutcome")||queryEncounterResult.length()<100) {//没对应就诊id 报错
                this.jTextArea_showXml.setText(queryEncounterResult);
                //结束
            }else{ 
                //患者 
                Patient patient = FhirContextContstant.getJsonParse().parseResource(Patient.class, queryPatientResult);
                String patientName = patient.getNameFirstRep().getText();
                jcbgBean.setRefPatientDisplay(patientName); 
                jcbgBean.setPatientActive("true");
                jcbgBean.setPatientNameAll(patientName);
                jcbgBean.setPatientFamilyName(patientName.substring(0,1));
                jcbgBean.setPatientGivenName(patientName.substring(1,patientName.length()));

                jcbgBean.setPatientPhoneType(patient.getTelecomFirstRep().getSystem().toCode());
                jcbgBean.setPatientPhoneNumber(patient.getTelecomFirstRep().getValue());
                jcbgBean.setPatientPhoneUse(patient.getTelecomFirstRep().getUse().toCode());

                jcbgBean.setPatientGender(patient.getGender().toCode());
                
                jcbgBean.setPatientBirthdate(new SimpleDateFormat("yyyy-MM-dd").format(patient.getBirthDate()));

                jcbgBean.setPatientAddressType(patient.getAddressFirstRep().getUse().toCode());    
                jcbgBean.setPatientAddressName(patient.getAddressFirstRep().getText());
                
                //就诊
                Encounter encounter =  FhirContextContstant.getJsonParse().parseResource(Encounter.class, queryEncounterResult);
                
                //jcbgBean.setEncounterId(encounter.getIdentifierFirstRep().getValue());
                jcbgBean.setEncounterId(jTextField_encounterId.getText());
                jcbgBean.setEncounterStatus(encounter.getStatus().toCode());
                jcbgBean.setEncounterTypeAlias(encounter.getClass_().getCode());
                jcbgBean.setEncounterTypeName(encounter.getClass_().getDisplay());
                //jcbgBean.setEncounterTypeDetail(encounter.getTypeFirstRep().getText());
                jcbgBean.setEncounterTypeDetail(this.jTextField_encounterTypeDetail.getText());

                jcbgBean.setEncounterSDateTime(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(encounter.getPeriod().getStart()));
                jcbgBean.setEncounterEDateTime(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(encounter.getPeriod().getEnd()));
                //执行创建
                 return setJcbg(evt, jcbgBean);
            }
        }
        return null;
    }
    //赋值
    private JcbgBean setJcbg(java.awt.event.ActionEvent evt, JcbgBean jcbgBean) {
        jcbgBean.setId("001");
        try{
            Date lastUpdatedDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(this.jTextField_lastUpdated.getText());
            jcbgBean.setLastUpdated(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(lastUpdatedDate));
        }catch(Exception ex) {
            logger.error("error 最后更新日期 日期转换错误，{}",ex);
        }
        jcbgBean.setDocumentAlias(this.jTextField_documentAlias.getText());
        jcbgBean.setDocumentAliasName(this.jTextField_documentAliasName.getText());
        jcbgBean.setType(this.jComboBox_type.getSelectedItem().toString());
        
        jcbgBean.setCompositionId(this.jTextField_compositionId.getText());
        try{
            Date compositionlastUpdatedDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(this.jTextField_compositionLastUpdate.getText());
            jcbgBean.setCompositionLastUpdate(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(compositionlastUpdatedDate));
        }catch(Exception ex) {
            logger.error("error 文档最近更新日期 日期转换错误，{}",ex);
        }

        jcbgBean.setCompositionStatus(this.jComboBox_compositionStatus.getSelectedItem().toString());
        jcbgBean.setCompositionTypeAlias(this.jTextField_compositionTypeAlias.getText());
        jcbgBean.setCompositionTypeName(this.jTextField_compositionTypeName.getText());
        
        //jcbgBean.setPatientId(this.jTextField_patientId.getText());
        //jcbgBean.setRefPatientDisplay(this.jTextField_refPatientDisplay.getText());
       try{
            Date reportDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(this.jTextField_reportDateTime.getText());
            jcbgBean.setReportDateTime(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(reportDateTime));
        }catch(Exception ex) {
            logger.error("error 报告日期 日期转换错误，{}",ex);
        }

        jcbgBean.setRefCompositionAuthor(this.jTextField_refCompositionAuthor.getText());
        jcbgBean.setCompositionAuthor(this.jTextField_compositionAuthor.getText());
        jcbgBean.setCompositionTitle(this.jTextField_compositionTitle.getText());
        jcbgBean.setCompositionLevel(this.jComboBox_compositionLevel.getSelectedItem().toString());
       
        //关联患者
//        jcbgBean.setPatientActive(this.jComboBox_patientActive.getSelectedItem().toString());
//         //姓名
//        String patientName = this.jTextField_patientName.getText();
//        jcbgBean.setPatientNameAll(patientName);
//        jcbgBean.setPatientFamilyName(patientName.substring(0,1));
//        jcbgBean.setPatientGivenName(patientName.substring(1,patientName.length()));
//        
//        jcbgBean.setPatientPhoneType(this.jComboBox_patientPhoneType.getSelectedItem().toString());
//        jcbgBean.setPatientPhoneNumber(this.jTextField_patientPhoneNumber.getText());
//        jcbgBean.setPatientPhoneUse(this.jComboBox_patientPhoneUse.getSelectedItem().toString());
//        
//        String gender = StringConvertUtil.convertGender( this.jComboBox_patientGender.getSelectedItem().toString() );
//        jcbgBean.setPatientGender(gender);
//        jcbgBean.setPatientBirthdate(this.jTextField_patientBirthdate.getText());
//        
//        jcbgBean.setPatientAddressType(this.jComboBox_patientAddressType.getSelectedItem().toString());
//        jcbgBean.setPatientAddressName(this.jTextField_patientAddressName.getText());
        
        //关联就诊
        //jcbgBean.setRefEcounter(this.jTextField_refEncounter.getText());
//        jcbgBean.setEncounterId(this.jTextField_encounterId.getText());
//        jcbgBean.setEncounterStatus(this.jComboBox_encounterStatus.getSelectedItem().toString());
//        jcbgBean.setEncounterTypeAlias(this.jComboBox_encounterTypeAlias.getSelectedItem().toString());
//        jcbgBean.setEncounterTypeName(this.jTextField_encounterTypeName.getText());
//        jcbgBean.setEncounterTypeDetail(this.jTextField_encounterTypeDetail.getText());
//        
//        jcbgBean.setEncounterSDateTime(this.jTextField_encounterSDateTime.getText());
//        jcbgBean.setEncounterEDateTime(this.jTextField_encounterEDateTime.getText());
        
        jcbgBean.setObservationId(this.jTextField_observationId.getText());
        jcbgBean.setObservationStatus(this.jComboBox_compositionStatus.getSelectedItem().toString());
        jcbgBean.setObservationTypeAlias(this.jComboBox_observationTypeAlias.getSelectedItem().toString());
        jcbgBean.setObservationTypeName(this.jComboBox_observationTypeName.getSelectedItem().toString());
        
        jcbgBean.setObservationItemAlias(this.jTextField_observationItemAlias.getText());
        jcbgBean.setObservationItemName(this.jTextField_observationItemName.getText());
        
        
        try {
            Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(this.jTextField_observationDateTime.getText());
            jcbgBean.setObservationDateTime( new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss+08:00").format(date));
        } catch (ParseException ex) {
            logger.error("error 检查时间 日期转换错误，{}",ex);
        }
        
        
        jcbgBean.setObservationDoctorId(this.jTextField_observationDoctorId.getText());
        jcbgBean.setObservationDoctor(this.jTextField_observationDoctor.getText());
        
        jcbgBean.setObservationResult(this.jTextArea_observationResult.getText());
        
        jcbgBean.setObservationPositionCode(this.jTextField_observationPositionCode.getText());
        jcbgBean.setObservationPosition(this.jTextField_observationPosition.getText());
        jcbgBean.setObservationMethodCode(this.jTextField_observationMethodCode.getText());
        jcbgBean.setObservationMethod(this.jTextField_observationMethod.getText());
        
        jcbgBean.setObservationEquipment(this.jTextField_observationEquipment.getText());
        
        return jcbgBean; 
    }
    
    //关闭窗口
    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        this.setDefaultCloseOperation(FhirJcbgGui.DISPOSE_ON_CLOSE);
        // TODO add your handling code here:
    }//GEN-LAST:event_formWindowClosing

     //查询
    private void jButton_queryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_queryActionPerformed
//        String url = this.jTextField_url.getText();
//        String patientId = this.jTextField_patientId.getText();
//        String patientName = this.jTextField_patientName.getText();
//        String result = null;
//        if (!StringUtils.isEmpty(patientId)) {
//            //url = url + "/" + patientId;
//            result = HttpUtil.sendGet(url);
//        } else if (!StringUtils.isEmpty(patientName)) {
//            try {   
//                patientName =  java.net.URLEncoder.encode(patientName,"utf-8");
//            } catch (UnsupportedEncodingException ex) {
//                java.util.logging.Logger.getLogger(FhirPatientGui.class.getName()).log(Level.SEVERE, null, ex);
//            }
//            //url = url + "/" + patientName;
//            result = HttpUtil.sendGet(url);
//        }
        String url = this.jTextField_url.getText();
        String datatType = this.jComboBox_dataType.getSelectedItem().toString();
        String result = null;

        if ("xml".equals(datatType)) {
            result = HttpUtil.sendGet(url,HttpUtil.ContentType_xml);
            result = FormatUtil.formatXml(result);
        } else if("json".equals(datatType)) {
            result = HttpUtil.sendGet(url,HttpUtil.ContentType_json);
            result = FormatUtil.formatJson(result);
        }
        //logger.info(" url={} result={} ",url, result);
        this.jTextArea_showXml.setText(result);

        //检索
    }//GEN-LAST:event_jButton_queryActionPerformed
    //历史查询
    private void jButton_queryHistoryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_queryHistoryActionPerformed
        jButton_queryActionPerformed(evt);
        
//        String url = this.jTextField_url.getText();
//        //String patientId = this.jTextField_patientId.getText();
//        String result = null;
////        if (!StringUtils.isEmpty(patientId)) {
////            //url = url + "/" + patientId;
////            result = HttpUtil.sendGet(url);
////        }
//        String datatType = this.jComboBox_dataType.getSelectedItem().toString();
//        result = HttpUtil.sendGet(url);
//        
//        if (!StringUtils.isEmpty(result)) {
//            if ("xml".equals(datatType)) {
//                result = FormatXmlUtil.formatXml(result);
//            } else if("json".equals(datatType)) {
//                 result = FormatJsonUtil.formatJson(result);
//            }
//            logger.info("query url result {} ", result);
//             this.jTextArea_showXml.setText(result);
//        }else{
//            this.jTextArea_showXml.setText("查询结果为空");
//        }
       
      
        // 获取历史版本
    }//GEN-LAST:event_jButton_queryHistoryActionPerformed
    //删除
    private void jButton_deleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_deleteActionPerformed
        //jButton_queryActionPerformed(evt);
        
        
//        String patientId = this.jTextField_patientId.getText().trim();
//
//        if (!StringUtils.isEmpty(patientId)) {
//            //url = url + "/" + patientId;
//            HttpUtil.sendGet(url);
//            this.jTextArea_showXml.setText("删除成功");
//        }
        String url = this.jTextField_url.getText().trim();
        String datatType = this.jComboBox_dataType.getSelectedItem().toString();
        String result = null;
        
        if ("xml".equals(datatType)) {
            result = HttpUtil.sendDelete(url,HttpUtil.ContentType_xml);
            result = FormatUtil.formatXml(result);
        } else if("json".equals(datatType)) {
            result = HttpUtil.sendDelete(url,HttpUtil.ContentType_json);
            result = FormatUtil.formatJson(result);
        }
        //logger.info("delete url result {} ", result);
        this.jTextArea_showXml.setText(result);

        // 删除
    }//GEN-LAST:event_jButton_deleteActionPerformed
    //更新
    private void jButton_updateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_updateActionPerformed
//        jcbgBean = new JcbgBean();
//        jcbgBean.setId(this.jTextField_id.getText());
//        jcbgBean.setLastUpdated(this.jTextField_lastUpdated.getText());
//        jcbgBean.setDocumentAlias(this.jTextField_documentAlias.getText());
//        jcbgBean.setDocumentAliasName(this.jTextField_documentAliasName.getText());
//        jcbgBean.setType(this.jComboBox_type.getSelectedItem().toString());
//        
//        jcbgBean.setCompositionId(this.jTextField_compositionId.getText());
//        jcbgBean.setCompositionLastUpdate(this.jTextField_compositionLastUpdate.getText());
//        jcbgBean.setCompositionStatus(this.jComboBox_compositionStatus.getSelectedItem().toString());
//        jcbgBean.setCompositionTypeAlias(this.jTextField_compositionTypeAlias.getText());
//        jcbgBean.setCompositionTypeName(this.jTextField_compositionTypeName.getText());
//        
//        jcbgBean.setPatientId(this.jTextField_patientId.getText());
//        jcbgBean.setRefPatientDisplay(this.jTextField_refPatientDisplay.getText());
//       
//        jcbgBean.setReportDateTime(this.jTextField_reportDateTime.getText());
//        
//        jcbgBean.setRefCompositionAuthor(this.jTextField_refCompositionAuthor.getText());
//        jcbgBean.setCompositionAuthor(this.jTextField_compositionAuthor.getText());
//        jcbgBean.setCompositionTitle(this.jTextField_compositionTitle.getText());
//        jcbgBean.setCompositionLevel(this.jComboBox_compositionLevel.getSelectedItem().toString());
//        
//        jcbgBean.setPatientActive(this.jComboBox_patientActive.getSelectedItem().toString());
//        
//         //姓名
//        String patientName = this.jTextField_patientName.getText();
//        jcbgBean.setPatientNameAll(patientName);
//        jcbgBean.setPatientFamilyName(patientName.substring(0,1));
//        jcbgBean.setPatientGivenName(patientName.substring(1,patientName.length()));
//        
//        jcbgBean.setPatientPhoneType(this.jComboBox_patientPhoneType.getSelectedItem().toString());
//        jcbgBean.setPatientPhoneNumber(this.jTextField_patientPhoneNumber.getText());
//        jcbgBean.setPatientPhoneUse(this.jComboBox_patientPhoneUse.getSelectedItem().toString());
//        
//        String gender = StringConvertUtil.convertGender( this.jComboBox_patientGender.getSelectedItem().toString() );
//        jcbgBean.setPatientGender(gender);
//        jcbgBean.setPatientBirthdate(this.jTextField_patientBirthdate.getText());
//        
//        jcbgBean.setPatientAddressType(this.jComboBox_patientAddressType.getSelectedItem().toString());
//        jcbgBean.setPatientAddressName(this.jTextField_patientAddressName.getText());
//        
//        jcbgBean.setRefEcounter(this.jTextField_refEncounter.getText());
//        jcbgBean.setEncounterId(this.jTextField_encounterId.getText());
//        jcbgBean.setEncounterStatus(this.jComboBox_encounterStatus.getSelectedItem().toString());
//        jcbgBean.setEncounterTypeAlias(this.jComboBox_encounterTypeAlias.getSelectedItem().toString());
//        jcbgBean.setEncounterTypeName(this.jTextField_encounterTypeName.getText());
//        jcbgBean.setEncounterTypeDetail(this.jTextField_encounterTypeDetail.getText());
//        
//        jcbgBean.setEncounterSDateTime(this.jTextField_encounterSDateTime.getText());
//        jcbgBean.setEncounterEDateTime(this.jTextField_encounterEDateTime.getText());
//        
//        jcbgBean.setObservationId(this.jTextField_observationId.getText());
//        jcbgBean.setObservationStatus(this.jComboBox_compositionStatus.getSelectedItem().toString());
//        jcbgBean.setObservationTypeAlias(this.jComboBox_observationTypeAlias.getSelectedItem().toString());
//        jcbgBean.setObservationTypeName(this.jComboBox_observationTypeName.getSelectedItem().toString());
//        
//        jcbgBean.setObservationItemAlias(this.jTextField_observationItemAlias.getText());
//        jcbgBean.setObservationItemName(this.jTextField_observationItemName.getText());
//        
//        jcbgBean.setObservationDateTime(this.jTextField_observationDateTime.getText());
//        
//        jcbgBean.setObservationDoctorId(this.jTextField_observationDoctorId.getText());
//        jcbgBean.setObservationDoctor(this.jTextField_observationDoctor.getText());
//        
//        jcbgBean.setObservationResult(this.jTextArea_observationResult.getText());
//        
//        jcbgBean.setObservationPositionCode(this.jTextField_observationPositionCode.getText());
//        jcbgBean.setObservationPosition(this.jTextField_observationPosition.getText());
//        jcbgBean.setObservationMethodCode(this.jTextField_observationMethodCode.getText());
//        jcbgBean.setObservationMethod(this.jTextField_observationMethod.getText());
//        
//        jcbgBean.setObservationEquipment(this.jTextField_observationEquipment.getText());
        //关联患者和就诊
        JcbgBean jcbgBean = relatePatientAndEncounterBean(evt);
        jcbgBean.setId(this.jTextField_id.getText());
        String url = this.jTextField_url.getText();
        String bundleString = "";
        String result = "";
        //获取发送数据的类型 xml/json
        String datatType = this.jComboBox_dataType.getSelectedItem().toString();
        if ("xml".equals(datatType)) {
           bundleString = MakeTempalteStringUtil.makeJcbgString(jcbgBean, "/template/jcbgTemplate.xml");
            bundleString = FormatUtil.formatXml(bundleString);
            logger.info("更新 bundle xml: {}", bundleString);
            result = HttpUtil.sendPut(url, bundleString, HttpUtil.ContentType_xml);
            result = FormatUtil.formatXml(result);
        } else if ("json".equals(datatType)){
            bundleString = MakeTempalteStringUtil.makeJcbgString(jcbgBean, "/template/json/jcbgTemplate.json");
            logger.info("更新 bundle json: {}", bundleString);
            result = HttpUtil.sendPut(url, bundleString, HttpUtil.ContentType_json);
            result = FormatUtil.formatJson(result);
        }
        this.jTextArea_showXml.setText(result);
        logger.info("更新成功");
        // 更新
    }//GEN-LAST:event_jButton_updateActionPerformed
    //清除
    private void jButton_clearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_clearActionPerformed
     
        this.jTextField_lastUpdated.setText("");
        this.jTextField_documentAlias.setText("");
        this.jTextField_documentAliasName.setText("");
        this.jTextField_compositionId.setText("");
        this.jTextField_compositionLastUpdate.setText("");
        this.jTextField_compositionTypeAlias.setText("");
        this.jTextField_compositionTypeName.setText("");
        this.jTextField_id.setText("");
        this.jTextField_refPatientDisplay.setText("");
        this.jTextField_reportDateTime.setText("");
        this.jTextField_refCompositionAuthor.setText("");
        this.jTextField_compositionAuthor.setText("");
        this.jTextField_compositionTitle.setText("");
        this.jTextField_patientName.setText("");
        this.jTextField_patientPhoneNumber.setText("");
        this.jTextField_patientAddressName.setText("");
        this.jTextField_refEncounter.setText("");
        this.jTextField_encounterId.setText("");
        this.jTextField_encounterTypeName.setText("");
        this.jTextField_encounterTypeDetail.setText("");
        this.jTextField_encounterTypeDetail.setText("");
        this.jTextField_encounterEDateTime.setText("");
        this.jTextField_observationId.setText("");
        this.jTextField_observationItemAlias.setText("");
        this.jTextField_observationItemName.setText("");
        this.jTextField_observationDateTime.setText("");
        this.jTextField_observationDoctorId.setText("");
        this.jTextField_observationDoctor.setText("");
        this.jTextArea_observationResult.setText("");
        this.jTextField_observationPositionCode.setText("");
        this.jTextField_observationPosition.setText("");
        this.jTextField_observationMethodCode.setText("");
        this.jTextField_observationMethod.setText("");
        this.jTextField_observationEquipment.setText("");
        // 清空
    }//GEN-LAST:event_jButton_clearActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FhirJcbgGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FhirJcbgGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FhirJcbgGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FhirJcbgGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        //</editor-fold>
        //</editor-fold>
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new FhirJcbgGui().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton_clear;
    private javax.swing.JButton jButton_create;
    private javax.swing.JButton jButton_delete;
    private javax.swing.JButton jButton_query;
    private javax.swing.JButton jButton_queryHistory;
    private javax.swing.JButton jButton_update;
    private javax.swing.JComboBox<String> jComboBox_compositionLevel;
    private javax.swing.JComboBox<String> jComboBox_compositionStatus;
    private javax.swing.JComboBox<String> jComboBox_dataType;
    private javax.swing.JComboBox<String> jComboBox_encounterStatus;
    private javax.swing.JComboBox<String> jComboBox_encounterTypeAlias;
    private javax.swing.JComboBox<String> jComboBox_observationStatus;
    private javax.swing.JComboBox<String> jComboBox_observationTypeAlias;
    private javax.swing.JComboBox<String> jComboBox_observationTypeName;
    private javax.swing.JComboBox<String> jComboBox_patientActive;
    private javax.swing.JComboBox<String> jComboBox_patientAddressType;
    private javax.swing.JComboBox<String> jComboBox_patientGender;
    private javax.swing.JComboBox<String> jComboBox_patientPhoneType;
    private javax.swing.JComboBox<String> jComboBox_patientPhoneUse;
    private javax.swing.JComboBox<String> jComboBox_type;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel_;
    private javax.swing.JLabel jLabel_compositionAuthor;
    private javax.swing.JLabel jLabel_compositionId;
    private javax.swing.JLabel jLabel_compositionLastUpdate;
    private javax.swing.JLabel jLabel_compositionLevel;
    private javax.swing.JLabel jLabel_compositionStatus;
    private javax.swing.JLabel jLabel_compositionTitle;
    private javax.swing.JLabel jLabel_compositionTypeAlias;
    private javax.swing.JLabel jLabel_compositionTypeName;
    private javax.swing.JLabel jLabel_documentAlias;
    private javax.swing.JLabel jLabel_documentAliasName;
    private javax.swing.JLabel jLabel_encounterEDateTime;
    private javax.swing.JLabel jLabel_encounterId;
    private javax.swing.JLabel jLabel_encounterSDateTime;
    private javax.swing.JLabel jLabel_encounterStatus;
    private javax.swing.JLabel jLabel_encounterTypeAlias;
    private javax.swing.JLabel jLabel_encounterTypeName;
    private javax.swing.JLabel jLabel_lastUpdated;
    private javax.swing.JLabel jLabel_observationDateTime;
    private javax.swing.JLabel jLabel_observationDoctorId;
    private javax.swing.JLabel jLabel_observationEquipment;
    private javax.swing.JLabel jLabel_observationId;
    private javax.swing.JLabel jLabel_observationItemAlias;
    private javax.swing.JLabel jLabel_observationItemName;
    private javax.swing.JLabel jLabel_observationMethod;
    private javax.swing.JLabel jLabel_observationMethodCode;
    private javax.swing.JLabel jLabel_observationPosition;
    private javax.swing.JLabel jLabel_observationPositionCode;
    private javax.swing.JLabel jLabel_observationResult;
    private javax.swing.JLabel jLabel_observationStatus;
    private javax.swing.JLabel jLabel_observationTypeAlias;
    private javax.swing.JLabel jLabel_observationTypeName;
    private javax.swing.JLabel jLabel_patientAddressType;
    private javax.swing.JLabel jLabel_patientBirthdate;
    private javax.swing.JLabel jLabel_patientGender;
    private javax.swing.JLabel jLabel_patientId;
    private javax.swing.JLabel jLabel_patientName;
    private javax.swing.JLabel jLabel_patientPhoneNumber;
    private javax.swing.JLabel jLabel_patientPhoneType;
    private javax.swing.JLabel jLabel_patientPhoneUse;
    private javax.swing.JLabel jLabel_refCompositionAuthor;
    private javax.swing.JLabel jLabel_refEncounter;
    private javax.swing.JLabel jLabel_refPatient;
    private javax.swing.JLabel jLabel_refPatientDisplay;
    private javax.swing.JLabel jLabel_reportDateTime;
    private javax.swing.JLabel jLabel_type;
    private javax.swing.JLabel jLabel_url;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JTextArea jTextArea_observationResult;
    private javax.swing.JTextArea jTextArea_showXml;
    private javax.swing.JTextField jTextField_compositionAuthor;
    private javax.swing.JTextField jTextField_compositionId;
    private javax.swing.JTextField jTextField_compositionLastUpdate;
    private javax.swing.JTextField jTextField_compositionTitle;
    private javax.swing.JTextField jTextField_compositionTypeAlias;
    private javax.swing.JTextField jTextField_compositionTypeName;
    private javax.swing.JTextField jTextField_documentAlias;
    private javax.swing.JTextField jTextField_documentAliasName;
    private javax.swing.JTextField jTextField_encounterEDateTime;
    private javax.swing.JTextField jTextField_encounterId;
    private javax.swing.JTextField jTextField_encounterSDateTime;
    private javax.swing.JTextField jTextField_encounterTypeDetail;
    private javax.swing.JTextField jTextField_encounterTypeName;
    private javax.swing.JTextField jTextField_id;
    private javax.swing.JTextField jTextField_lastUpdated;
    private javax.swing.JTextField jTextField_observationDateTime;
    private javax.swing.JTextField jTextField_observationDoctor;
    private javax.swing.JTextField jTextField_observationDoctorId;
    private javax.swing.JTextField jTextField_observationEquipment;
    private javax.swing.JTextField jTextField_observationId;
    private javax.swing.JTextField jTextField_observationItemAlias;
    private javax.swing.JTextField jTextField_observationItemName;
    private javax.swing.JTextField jTextField_observationMethod;
    private javax.swing.JTextField jTextField_observationMethodCode;
    private javax.swing.JTextField jTextField_observationPosition;
    private javax.swing.JTextField jTextField_observationPositionCode;
    private javax.swing.JTextField jTextField_patientAddressName;
    private javax.swing.JTextField jTextField_patientBirthdate;
    private javax.swing.JTextField jTextField_patientId;
    private javax.swing.JTextField jTextField_patientName;
    private javax.swing.JTextField jTextField_patientPhoneNumber;
    private javax.swing.JTextField jTextField_refCompositionAuthor;
    private javax.swing.JTextField jTextField_refEncounter;
    private javax.swing.JTextField jTextField_refPatientDisplay;
    private javax.swing.JTextField jTextField_reportDateTime;
    private javax.swing.JTextField jTextField_url;
    // End of variables declaration//GEN-END:variables
}
